package day05;

import javax.swing.JOptionPane;

public class Controller {
	private Shujuku shujuku;
	private ClientContext clientcontext;
	private Paper paper;
	
	public User login(String id,String password) {
		//跟数据库比
		User user =shujuku.getUserById(id);
		if(user ==null||!user.getUserpassword().equals(password)) {
			JOptionPane.showMessageDialog(null, "用户名或密码错误");
		
		}else {
			return user;
		}
		return null;
	}


	
	
	

	

	public Shujuku getShujuku() {
		return shujuku;
	}

	public ClientContext getClientcontext() {
		return clientcontext;
	}
	public void setClientcontext(ClientContext clientcontext) {
		this.clientcontext = clientcontext;
	}
	public Paper getPaper() {
		return paper;
	}

	public void setshujuku(Shujuku shujuku) {
		this.shujuku = shujuku;
	}
}
